/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_relational_expression.cpp

	$Header: /heroes4/script_relational_expression.cpp $

	$NoKeywords: $

 ************************************************************************/

#include "precompiled.h"
#pragma warning( disable: 4786 )

#include "script_relational_expression.h"

// -----------------------------------
// -----------------------------------

t_script_relational_expression::t_result 
t_script_relational_expression::evaluate(t_expression_context_hero const& context) const
{
	return do_evaluation (
		get_left_subexpression().evaluate(context),
		get_right_subexpression().evaluate(context));
}

t_script_relational_expression::t_result 
t_script_relational_expression::evaluate(t_expression_context_town const& context) const
{
	return do_evaluation (
		get_left_subexpression().evaluate(context),
		get_right_subexpression().evaluate(context));
}

t_script_relational_expression::t_result 
t_script_relational_expression::evaluate(t_expression_context_object const& context) const
{
	return do_evaluation (
		get_left_subexpression().evaluate(context),
		get_right_subexpression().evaluate(context));
}

t_script_relational_expression::t_result 
t_script_relational_expression::evaluate(t_expression_context_army const& context) const
{
	return do_evaluation (
		get_left_subexpression().evaluate(context),
		get_right_subexpression().evaluate(context));
}

t_script_relational_expression::t_result 
t_script_relational_expression::evaluate(t_expression_context_global const& context) const
{
	return do_evaluation (
		get_left_subexpression().evaluate(context),
		get_right_subexpression().evaluate(context));
}

// -----------------------------------
// -----------------------------------

t_script_expression_equals::t_result 
t_script_expression_equals::do_evaluation(t_subexpression::t_result left, t_subexpression::t_result right) const
{
	return left == right;
}

t_script_expression_equals::t_result 
t_script_expression_less_than::do_evaluation(t_subexpression::t_result left, t_subexpression::t_result right) const
{
	return left < right;
}

t_script_expression_equals::t_result 
t_script_expression_greater_than::do_evaluation(t_subexpression::t_result left, t_subexpression::t_result right) const
{
	return left > right;
}

t_script_expression_equals::t_result 
t_script_expression_less_than_or_equals::do_evaluation(t_subexpression::t_result left, t_subexpression::t_result right) const
{
	return left <= right;
}

t_script_expression_equals::t_result 
t_script_expression_greater_than_or_equals::do_evaluation(t_subexpression::t_result left, t_subexpression::t_result right) const
{
	return left >= right;
}
